#define _CRT_SECURE_NO_WARNINGS 1


#include<string>
#include<iostream>
#include<stdlib.h>

using namespace std;

string makeGood(string s)
{
    size_t size = s.size();
    string RetString;
    for (size_t i = 0; i < size - 1; i++)
    {
        if (s[i] >= 'a' && s[i] <= 'z')
        {
            if (s[i + 1] != s[i] - 32 && (!RetString.empty() && RetString.back() != s[i] - 32))
            {
                RetString += s[i];
            }
        }
        else
        {
            if (s[i + 1] != s[i] + 32 && (!RetString.empty() && RetString.back() != s[i] + 32))
            {
                RetString += s[i];
            }
        }
    }
    if (s[size - 1] >= 'a' && s[size - 1] <= 'z')
    {
        if (!RetString.empty() && RetString.back() != s[size - 1] - 32)
        {
            RetString += s[size - 1];
        }
    }
    else
    {
        if (!RetString.empty() && RetString.back() != s[size - 1] + 32)
        {
            RetString += s[size - 1];
        }
    }
    return s;
}
int main()
{
    string s("leEeetcode");
    cout << makeGood(s) << endl;

	return 0;
}